home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.03 Mar 88 / GLA source / modified_MultiFinder.h < prev   
Encoding:
C/C++ Source or Header  |  1987-12-21  |  2.5 KB  |  137 lines  |  [TEXT/KAHL]

  1. /*
  2.     MultiFinder.h -- MultiFinder Interfaces
  3.  
  4.     C Interface to the Macintosh Libraries
  5.     Copyright Apple Computer,Inc.    1987
  6.     All rights reserved.
  7. */
  8.  
  9. #ifndef __MULTIFIN__
  10. #define __MULTIFIN__
  11. #ifndef __EVENTS__
  12. #endif
  13. #ifndef __QUICKDRAW__
  14. #endif
  15.  
  16.  
  17. /* MultiFinder dispatch trap */
  18.  
  19. #define _OSDISPATCH                0xA88F
  20. #define    _WAITNEXTEVENT            0xA860
  21.  
  22.  
  23.  
  24. /* Routine selector values */
  25.  
  26. #define mfMaxMemSel                    21
  27. #define mfFreeMemSel                24
  28. #define mfTempNewHandleSel            29
  29. #define mfTempHLockSel                30
  30. #define mfTempHUnLockSel            31
  31. #define mfTempDisposHandleSel        32
  32.  
  33.  
  34. #define MFMaxMem(grow) \
  35.     cMFMaxMem(grow,mfMaxMemSel)
  36.     
  37. #define MFFreeMem() \
  38.     cMFFreeMem(mfFreeMemSel)
  39.     
  40. #define MFTempNewHandle(logicalSize,resultCode) \
  41.     cMFTempNewHandle(logicalSize,resultCode,mfTempNewHandleSel)
  42.     
  43. #define MFTempHLock(h,resultCode) \
  44.     cMFTempHLock(h,resultCode,mfTempHLockSel)
  45.     
  46. #define MFTempHUnLock(h,resultCode) \
  47.     cMFTempHUnLock(h,resultCode,mfTempHUnLockSel)
  48.     
  49. #define MFTempDisposHandle(h,resultCode) \
  50.     cMFTempDisposHandle(h,resultCode,mfTempDisposHandleSel)
  51.  
  52.  
  53. /*    WaitNextEvent was released in MPW 2.0 interfaces. It is
  54.     commented out below to avoid a duplicate declaration.
  55.     Uncomment only if working with earlier interfaces. */
  56.  
  57. pascal Boolean WaitNextEvent(mask,event,sleep,mouseRgn)
  58.     unsigned short mask;
  59.     EventRecord *event;
  60.     unsigned long sleep;
  61.     RgnHandle mouseRgn;
  62.     {
  63.         asm {
  64.             SUBQ.L    #2, SP
  65.             MOVE.W    20(A6), -(SP)        /*    short mask    */
  66.             MOVE.L    16(A6), -(SP)        /*    long *event    */
  67.             MOVE.L    12(A6), -(SP)        /*    long sleep    */
  68.             MOVE.L    8(A6), -(SP)        /*    long handle    */
  69.             DC.W    _WAITNEXTEVENT
  70.             MOVE.W    (SP)+, 22(A6)        /*    return stack pointer to where it started from    */
  71.         }
  72.     }
  73.  
  74. pascal long cMFMaxMem(grow, SW)
  75.     long            *grow;
  76.     short            SW;
  77.     {
  78.         asm{
  79.             SUBQ.L    #4, SP
  80.             MOVE.L    10(A6), -(SP)        /*    long *grow    */
  81.             MOVE.W    8(A6), -(SP)        /*    short SW    */
  82.             DC.W    _OSDISPATCH
  83.             MOVE.L    (SP)+, 14(A6)        /*    return stack pointer to where it started from    */
  84.         }
  85.     }
  86.  
  87. pascal Size cMFFreeMem(SW)
  88.     short            SW;
  89.     {
  90.         asm{
  91.             DC.W    _OSDISPATCH
  92.         }
  93.     }
  94.     
  95. pascal Handle cMFTempNewHandle(logicalSize, resultCode, SW)
  96.     unsigned long    logicalSize;
  97.     short             *resultCode;
  98.     short             SW;
  99.     {
  100.         asm{
  101.             DC.W    _OSDISPATCH
  102.         }
  103.     }
  104.     
  105. pascal void cMFTempHLock(h, resultCode, SW)
  106.     Handle            h;
  107.     short             *resultCode;
  108.     short             SW;
  109.     {
  110.         asm{
  111.             DC.W    _OSDISPATCH
  112.         }
  113.     }
  114.     
  115. pascal void cMFTempHUnLock(h, resultCode, SW)
  116.     Handle            h;
  117.     short             *resultCode;
  118.     short             SW;
  119.     {
  120.         asm{
  121.             DC.W    _OSDISPATCH
  122.         }
  123.     }
  124.     
  125. pascal void cMFTempDisposHandle(h, resultCode, SW)
  126.     Handle            h;
  127.     short             *resultCode;
  128.     short             SW;
  129.     {
  130.         asm{
  131.             DC.W    _OSDISPATCH
  132.         }
  133.     }
  134.     
  135.  
  136. #endif
  137.